namespace Jumpton.SFA.Server.Entity
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Jumpton.Persistent;
    using System.Data;
    using System.Runtime.Serialization;


    [System.SerializableAttribute()]
    [RelationMap("ORDER_LINES", typeof(ORDER_LINES), "a")]
    [Relation(RelationJoinType.Inner, typeof(PRODUCTS), "b", "a", "ID", "PRODUCT_ID")]
    public class ORDERLINEVIEW : ObjectRow
    {

        public ORDERLINEVIEW()
        {
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">DataTable 中的一行数据</param>
        /// <param name="objectTable">存储当前对象的数据表格</param>
        public ORDERLINEVIEW(System.Data.DataRow dataRow, ObjectTable parent) :
            base(dataRow, parent)
        {
        }

        /// <summary>
        /// 供反序列化使用的构造函数
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected ORDERLINEVIEW(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
            base(info, context)
        {
        }

        [Key("ID", TableAlias = "a")]
        public decimal ID
        {
            get
            {
                return (System.Decimal)GetValue("ID");
            }
            set
            {
                SetValue("ID", value);
            }
        }

        [Field("ORDER_NO", TableAlias = "a")]
        public string ORDERNO
        {
            get
            {
                return (System.String)GetValue("ORDERNO");
            }
            set
            {
                SetValue("ORDERNO", value);
            }
        }

        [Field("PRODUCT_ID", TableAlias = "a")]
        public int PRODUCTID
        {
            get
            {
                return (System.Int32)GetValue("PRODUCTID");
            }
            set
            {
                SetValue("PRODUCTID", value);
            }
        }

        [Field("UOM_CODE", TableAlias = "a")]
        public string UOMCODE
        {
            get
            {
                return (System.String)GetValue("UOMCODE");
            }
            set
            {
                SetValue("UOMCODE", value);
            }
        }

        [Field("PRODUCT_CODE", TableAlias = "a")]
        public string PRODUCTCODE
        {
            get
            {
                return (System.String)GetValue("PRODUCTCODE");
            }
            set
            {
                SetValue("PRODUCTCODE", value);
            }
        }

        [Field("QUANTITY_ORDERED", TableAlias = "a")]
        public decimal QUANTITYORDERED
        {
            get
            {
                return (System.Decimal)GetValue("QUANTITYORDERED");
            }
            set
            {
                SetValue("QUANTITYORDERED", value);
            }
        }

        [Field("QUANTITY_SHIPPED", TableAlias = "a")]
        public decimal QUANTITYSHIPPED
        {
            get
            {
                return (System.Decimal)GetValue("QUANTITYSHIPPED");
            }
            set
            {
                SetValue("QUANTITYSHIPPED", value);
            }
        }

        [Field("LINE_AMOUNT", TableAlias = "a")]
        public decimal LINE_AMOUNT
        {
            get
            {
                return (System.Decimal)GetValue("LINE_AMOUNT");
            }
            set
            {
                SetValue("LINE_AMOUNT", value);
            }
        }

        [Field("LINE_DISC_RATE", TableAlias = "a")]
        public decimal LINEDISCRATE
        {
            get
            {
                return (System.Decimal)GetValue("LINEDISCRATE");
            }
            set
            {
                SetValue("LINEDISCRATE", value);
            }
        }

        [Field("LINE_DISC_AMOUNT", TableAlias = "a")]
        public decimal LINEDISCAMOUNT
        {
            get
            {
                return (System.Decimal)GetValue("LINEDISCAMOUNT");
            }
            set
            {
                SetValue("LINEDISCAMOUNT", value);
            }
        }

        [Field("SKU_DISC_RATE", TableAlias = "a")]
        public decimal SKUDISCRATE
        {
            get
            {
                return (System.Decimal)GetValue("SKUDISCRATE");
            }
            set
            {
                SetValue("SKUDISCRATE", value);
            }
        }

        [Field("SKU_DISC_AMOUNT", TableAlias = "a")]
        public decimal SKUDISCAMOUNT
        {
            get
            {
                return (System.Decimal)GetValue("SKUDISCAMOUNT");
            }
            set
            {
                SetValue("SKUDISCAMOUNT", value);
            }
        }

        [Field("DOMAIN_ID", TableAlias = "a")]
        public decimal DOMAINID
        {
            get
            {
                return (System.Decimal)GetValue("DOMAINID");
            }
            set
            {
                SetValue("DOMAINID", value);
            }
        }

        [Field("REC_USER_CODE", TableAlias = "a")]
        public string RECUSERCODE
        {
            get
            {
                return (System.String)GetValue("RECUSERCODE");
            }
            set
            {
                SetValue("RECUSERCODE", value);
            }
        }

        [Field("REC_TIME_STAMP", TableAlias = "a")]
        public decimal LAST_UPDATE_TIME
        {
            get
            {
                return (System.Decimal)GetValue("LAST_UPDATE_TIME");
            }
            set
            {
                SetValue("LAST_UPDATE_TIME", value);
            }
        }

        [Field("CANCELLED", TableAlias = "a")]
        public string CANCELLED
        {
            get
            {
                return (System.String)GetValue("CANCELLED");
            }
            set
            {
                SetValue("CANCELLED", value);
            }
        }

        [Field("FREE_PRODUCTS", TableAlias = "a")]
        public int FREEPRODUCTS
        {
            get
            {
                return (System.Int32)GetValue("FREEPRODUCTS");
            }
            set
            {
                SetValue("FREEPRODUCTS", value);
            }
        }

        [Field("DISC_1", TableAlias = "a")]
        public decimal DISC1
        {
            get
            {
                return (System.Decimal)GetValue("DISC1");
            }
            set
            {
                SetValue("DISC1", value);
            }
        }

        [Field("DISC_2", TableAlias = "a")]
        public decimal DISC2
        {
            get
            {
                return (System.Decimal)GetValue("DISC2");
            }
            set
            {
                SetValue("DISC2", value);
            }
        }

        [Field("Quantity_Received", TableAlias = "a")]
        public decimal QuantityReceived
        {
            get
            {
                return (System.Decimal)GetValue("QuantityReceived");
            }
            set
            {
                SetValue("QuantityReceived", value);
            }
        }
        [Field("Confirmed_Date", TableAlias = "a")]
        public System.Decimal Confirmed_Date
        {
            get
            {
                return (System.Decimal)GetValue("Confirmed_Date");
            }
            set
            {
                SetValue("Confirmed_Date", value);
            }
        }
        [Field("Confirm_user_code", TableAlias = "a")]
        public string Confirm_user_code
        {
            get
            {
                return (System.String)GetValue("Confirm_user_code");
            }
            set
            {
                SetValue("Confirm_user_code", value);
            }
        }
        [Field("ARRIVAL_date", TableAlias = "a")]
        public System.Decimal ARRIVAL_date
        {
            get
            {
                try
                {
                    return (System.Decimal)GetValue("ARRIVAL_date");
                }
                catch
                {
                    return 0;
                }
            }
            set
            {
                SetValue("ARRIVAL_date", value);
            }
        }

        [Field("OrderLineStatus", TableAlias = "a")]
        public decimal OrderLineStatus
        {
            get
            {
                return (System.Decimal)GetValue("OrderLineStatus");
            }
            set
            {
                SetValue("OrderLineStatus", value);
            }
        }

        [Field("OWN_PRO_ID", TableAlias = "a")]
        public int OWNPROID
        {
            get
            {
                return (System.Int32)GetValue("OWNPROID");
            }
            set
            {
                SetValue("OWNPROID", value);
            }
        }

        [Field("PROMOTION_ID", TableAlias = "a")]
        public decimal PROMOTIONID
        {
            get
            {
                return (System.Decimal)GetValue("PROMOTIONID");
            }
            set
            {
                SetValue("PROMOTIONID", value);
            }
        }

        [Field("ABNORMITY_TYPE", TableAlias = "a")]
        public int ABNORMITY_TYPE
        {
            get
            {
                return (System.Int32)GetValue("ABNORMITY_TYPE");
            }
            set
            {
                SetValue("ABNORMITY_TYPE", value);
            }
        }

        [Field("QUANTITY_SHIPPED", TableAlias = "a")]
        public decimal QUANTITY_SHIPPED
        {
            get
            {
                return GetValue("QUANTITY_SHIPPED") == null ? 0 : (System.Decimal)GetValue("QUANTITY_SHIPPED");
            }
            set
            {
                SetValue("QUANTITY_SHIPPED", value);
            }
        }

        [Field("SHORT_DESCRIPTION", TableAlias = "b")]
        public string SHORT_DESCRIPTION
        {
            get
            {
                return (System.String)GetValue("SHORT_DESCRIPTION");
            }
            set
            {
                SetValue("SHORT_DESCRIPTION", value);
            }
        }

    }
}
